#ifndef LIBRARY_H
#define LIBRARY_H
#include <QWidget>
#include <QProgressBar>
#include <QMutex>

class Library: public QWidget
{
    Q_OBJECT
    QProgressBar booksUsed;
    QProgressBar doing;
    QProgressBar waiting;

    int booksCount, added, persons;
    QMutex * books;
    QMutex libMutex;

    bool closed;
public:
    Library(int booksCount);

    int getBooksCount();

    bool tryAcquireBook(int index);

    void acquireBook(int index);

    void releaseBook(int index);

    int addBook();

    void registerPerson();

    void close();

    bool isClosed();
};

#endif // LIBRARY_H
